|
[ Intro ] [ Lesson1 ] [ Lesson2 ] [ Lesson3 ] [ Lesson4 ] [ Lesson5 ] [ Lesson6 ] [ Lesson7 ] [ Lesson8 ] |
||||
|
And then some firing scripts. Note that there are several stages of preparing
a proper animation.
This is the script seen in Lesson 3, but with the addition of what actuons you should do to get it work. First of all, your unit should have a flare piece named flare that could look like a little explosion or just a brigt ball. Next, you need to hide it as soon as the unit is created. Real life weapons aren't walking around with permanent fire out of the barrels, right? Nevertheless, you show it again for a brief moment, just enough time for the eye to catch a glimpse of it.
This time, we have two barrels and we want both to fire every other turn. So we set a static-var to 1, as in barrel1. If "alternate" is equal to 1, we run the animation for barrel1 and flare1. If it's equal to two, we run the same thing, but for the second barrel. After the eventual animation, we increase the value of "alternate" and if gets too large, we set it back to the lowest value again. To sum it up, every time the script runs through this, it will choose a different barrel than the previous. This script is easy to expand to fit in three or four or fiftynine barrels. It doesn't matter, since the basic function is the same. Important: When having multi-barreled weapons, you will
have to make sure that the query points alternate as well, or one barrel
will recoil, but the shot will fly out of the other. That, quite frankly,
sucks... Congratulations, if you mastered this part, you can continue reading Lesson 3. |
||||
| Storm | ||||